{{Extend "layout"}}
{{Block "title"}}{{"后台oAuth应用管理"|$.T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"后台oAuth应用管理"|$.T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
	<div class="col-md-12">
		<div class="block-flat no-padding">
			<div class="header">
				<a href="{{BackendURL}}/manager/oauth_app/add" class="btn btn-success pull-right">
					<i class="fa fa-plus"></i>
					{{"添加应用"|$.T}}
				</a>							
				<h3>{{"应用列表"|$.T}}</h3>
			</div>
			<div class="content">
				<div class="table-responsive">
				<table class="table no-border hover">
					<thead class="no-border">
						<tr>
							<th style="width:2%;"><strong>ID</strong></th>
							<th style="width:60px"><strong>{{"状态"|$.T}}</strong></th>
							<th style="width:150px"><strong>{{"APP ID"|$.T}}</strong></th>
							<th><strong>{{"站点名称"|$.T}}</strong></th>
							<th><strong>{{"域名"|$.T}}</strong></th>
							<th style="width:130px"><strong>{{"创建时间"|$.T}}</strong></th>
							<th style="width:130px" class="text-center"><strong>{{"操作"|$.T}}</strong></th>
						</tr>
					</thead>
					<tbody class="no-border-y">
                        {{range $k,$v := $.Stored.listData}}
						<tr>
							<td>{{$v.Id}}</td>
							<td>
							<div class="checkbox checkbox-primary no-margin-y">
								<input type="checkbox" id="checkbox-disabled-{{$k}}" value="N" class="switch-disabled" data-id="{{$v.Id}}"{{if eq $v.Disabled `N`}} checked="checked"{{end}} data-url="manager/oauth_app/edit/{{$v.Id}}" /> <label for="checkbox-disabled-{{$k}}">{{"启用"|$.T}}</label>
							</div>
							</td>
							<td>{{$v.AppId}}</td>
							<td>{{$v.SiteName}}</td>
							<td>{{$v.SiteDomains|Default ($.T `不限`)}}</td>
							<td>{{(Date $v.Created).Format "2006-01-02 15:04:05"}}</td>
							<td class="text-center">
							<a class="label label-default" href="{{BackendURL}}/manager/oauth_app/add?copyId={{$v.Id}}" title="{{`复制`|$.T}}" data-toggle="tooltip"><i class="fa fa-copy"></i></a>
							<a class="label label-success" href="{{BackendURL}}/manager/oauth_app/edit/{{$v.Id}}" title="{{`编辑`|$.T}}" data-toggle="tooltip"><i class="fa fa-pencil"></i></a> 
							<a class="label label-danger" href="{{BackendURL}}/manager/oauth_app/delete/{{$v.Id}}" onclick="return confirm('{{`真的要删除吗？`|$.T}}');" title="{{`删除`|$.T}}" data-toggle="tooltip"><i class="fa fa-times"></i></a>
							</td>
						</tr>
                        {{end}}
					</tbody>
				</table>		
				</div>
				{{$.Stored.pagination.Render}}
			</div>
		</div>				
	</div>
</div>
{{/Block}}
{{Block "footer"}}
<script>
$(function(){
	App.bindSwitch('input.switch-disabled','click');
});
</script>
{{/Block}}